package cn.italkcloud.cph.config.security;

import cn.italkcloud.cph.config.handler.GlobalRequestHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * WEB 安全配置
 *
 * @author dominate
 * @since 2021/11/26
 */
@Configuration
public class RequestFilter implements WebMvcConfigurer {


    private static final String ALL_PATH_PATTERNS = "/**";
    private static final String[] EXCLUDE_PATHS = {};


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new GlobalRequestHandler())
                .addPathPatterns(ALL_PATH_PATTERNS)
                .excludePathPatterns(EXCLUDE_PATHS);
    }

}
